# This file is part of BlackArch Linux ( https://www.blackarch.org/ ).
# See COPYING for license details.

pkgname=yay
pkgver=12.5.3
pkgrel=1
pkgdesc='Yet another yogurt. Pacman wrapper and AUR helper written in go.'
arch=('x86_64' 'aarch64')
groups=('blackarch' 'blackarch-misc')
url='https://github.com/Jguer/yay'
license=('GPL3')
depends=('pacman' 'git')
makedepends=('go-pie')
optdepends=('sudo')
source=("https://github.com/Jguer/$pkgname/archive/v$pkgver.tar.gz")
sha512sums=('fb88ba5693cb80397ec774ff3a30be17907483a375e83f6d2519e0e8558c873394dbbd5e4f3a272ed5cd7505b36ce2741ca0c4d3a4f0d798436c235259e26063')

build() {
  cd "$pkgname-$pkgver"

  EXTRA_GOFLAGS="-gcflags all=-trimpath=${PWD} -asmflags all=-trimpath=${PWD}" \
    LDFLAGS="-linkmode external -extldflags \"${LDFLAGS}\"" \
    make VERSION="$pkgver" DESTDIR="$pkgdir" build
}

package() {
  cd "$pkgname-$pkgver"

  make VERSION="$pkgver" DESTDIR="$pkgdir" PREFIX=/usr install
}

